docs: link manpage cross-references in HTML output#4246
Open
grandixximo wants to merge 4 commits into
Open
Conversation
Add an asciidoctor postprocessor that turns name(section) references in the HTML manpages into clickable links to the sibling page. Index-gated against the rendered troff tree so false positives (enum values, external and misspelled pages) stay plain text; self-links, code spans and existing links are left untouched. Wired into the manpage HTML rule via manxref-root.
motion(1) and hal_thread_new(3) name pages that do not exist. Point them at the actual pages motion(9) and hal_create_thread(3).
Extend the man_xref postprocessor to the User/HAL/Integrator HTML manuals, which cite man pages in the same name(section) form. A per-page manxref-linkbase attribute carries the depth-adjusted path to the language's man/man<N>/ tree; manpages keep the sibling default. Index-gated as before, so only real pages link and prose like TRUE(1) stays plain.
grandixximo
force-pushed
the
feat/man-xref-links
branch
from
July 17, 2026 03:45
1be89ba to
653e6cf
Compare
Contributor
|
Some parts of the manual pages are a bit stale and needs cleaning up. In fact, I was doing exactly that for the hal_*(3) set of pages and adding a lot of them when this issue of linking caught my attention. |
Contributor
Author
|
Should I drop the doc fixes then? just have the script? |
Contributor
No, your fixes are just fine. The "other" fixes is to read them all from start to end, fix inconsistencies, add missing, remove obsolete and reformat them to become uniform. But that is a different affair of incremental changes over a longer period. |
Contributor
|
One thing though, maybe add to lcnc-overrides.css: .man-xref {
font-family: monospace;
font-size: 90%;
}We'll tackle the spurious bolds, italics and splits ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #4244.
What
Adds an asciidoctor postprocessor (
docs/src/extensions/man_xref.rb) that turnsname(section)manpage references (halcmd(1),stepgen(9), ...) into clickable links to the corresponding HTML page. Applied to both:man/), and../man/manN/.Wired into both HTML rules in
docs/src/Submakefile. Per-pagemanxref-root(troff tree) andmanxref-linkbase(depth-adjusted path) attributes drive it; absent => no-op.How it stays correct
Index-gated: a token links only when a real page
name.sectionexists in that language's troff tree. Common false positives resolve to nothing and stay plain, with no skip list:feed(2)/arc(3)inmotion(9)open(2),printf(3),udev(8)TRUE(1),time.sleep(1)Also: never self-links; skips
<a> <code> <pre> <script> <style> <head> <title> <h1>(code, attributes, existing links untouched); case-insensitive match with verbatim visible text.Verification
de/man/).BUILD_DOCS_TRANSLATED=yesbuild currently cannot complete due to a pre-existing po4a NAME-drift issue (a stray space in a German man page NAME yields a dangling.soalias), tracked in docs: pin manpage troff filename to the make target #4193 / CI: Check html links for doc #4178. Unrelated to this change; the links themselves render correctly per language.Also included
Source refs the linker surfaced as broken, fixed to the real pages:
motion(1)=>motion(9)inhal_manualtoolchange(1)hal_thread_new(3)=>hal_create_thread(3)inhal_add_funct_to_thread(3)stegen(9)=>stepgen(9)in the hostmot2 driver docsNotes
link:refs (e.g.SSERIAL(9),debounce(9)) are left untouched: the postprocessor skips anything already inside an<a>.hm2_uart_setup_chan(3)inhostmot2(9)names no existing page; left as-is. @pcw-mesa stale/renamed name, or a missing page?